# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Forms.V1.Model.UpdateItemRequest do
  @moduledoc """
  Update an item in a form.

  ## Attributes

  *   `item` (*type:* `GoogleApi.Forms.V1.Model.Item.t`, *default:* `nil`) - Required. New values for the item. Note that item and question IDs are used if they are provided (and are in the field mask). If an ID is blank (and in the field mask) a new ID is generated. This means you can modify an item by getting the form via forms.get, modifying your local copy of that item to be how you want it, and using UpdateItemRequest to write it back, with the IDs being the same (or not in the field mask).
  *   `location` (*type:* `GoogleApi.Forms.V1.Model.Location.t`, *default:* `nil`) - Required. The location identifying the item to update.
  *   `updateMask` (*type:* `String.t`, *default:* `nil`) - Required. Only values named in this mask are changed.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :item => GoogleApi.Forms.V1.Model.Item.t() | nil,
          :location => GoogleApi.Forms.V1.Model.Location.t() | nil,
          :updateMask => String.t() | nil
        }

  field(:item, as: GoogleApi.Forms.V1.Model.Item)
  field(:location, as: GoogleApi.Forms.V1.Model.Location)
  field(:updateMask)
end

defimpl Poison.Decoder, for: GoogleApi.Forms.V1.Model.UpdateItemRequest do
  def decode(value, options) do
    GoogleApi.Forms.V1.Model.UpdateItemRequest.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Forms.V1.Model.UpdateItemRequest do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
